﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaObustavaNaknada typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaObustavaNaknadaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaObustavaNaknadaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaObustavaNaknada _currentOsobaObustavaNaknada = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaObustavaNaknadaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaObustavaNaknadaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaObustavaNaknadaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljNaziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljSjediste property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljSjedisteDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the OpisPlacanja property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOpisPlacanjaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ZiroRacun property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxZiroRacunDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DanIsplateUMjesecu property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDanIsplateUMjesecuDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Model property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxModelDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PozivNaBroj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPozivNaBrojDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObustavaNaknadaTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObustavaNaknadaTipDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PonavljanjeSvakihMjeseci property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPonavljanjeSvakihMjeseciDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PonavljajOdDatuma property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPonavljajOdDatumaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PonavljajDoDatuma property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPonavljajDoDatumaDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ObustavaNaknadaTip> _IDObustavaNaknadaTipList;
		
		/// <summary> 
		/// The list of selectable ObustavaNaknadaTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObustavaNaknadaTip> IDObustavaNaknadaTipList
		{
			get {return this._IDObustavaNaknadaTipList;}
			set 
			{
				this._IDObustavaNaknadaTipList = value;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = null;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = this._IDObustavaNaknadaTipList;
			}
		}
		
		private bool _allowNewItemInIDObustavaNaknadaTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObustavaNaknadaTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObustavaNaknadaTipList
		{
			get { return _allowNewItemInIDObustavaNaknadaTipList;}
			set
			{
				this._allowNewItemInIDObustavaNaknadaTipList = value;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaObustavaNaknada> _OsobaObustavaNaknadaList;
				
		/// <summary> 
		/// The list of OsobaObustavaNaknada to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaObustavaNaknada> OsobaObustavaNaknadaList
		{
			get {return this._OsobaObustavaNaknadaList;}
			set
			{
				this._OsobaObustavaNaknadaList = value;
				this.uxOsobaObustavaNaknadaBindingSource.DataSource = null;
				this.uxOsobaObustavaNaknadaBindingSource.DataSource = value;
				this.uxOsobaObustavaNaknadaDataGridView.DataSource = null;
				this.uxOsobaObustavaNaknadaDataGridView.DataSource = this.uxOsobaObustavaNaknadaBindingSource;				
				//this.uxOsobaObustavaNaknadaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaObustavaNaknadaBindingSource_ListChanged);
				this.uxOsobaObustavaNaknadaBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaObustavaNaknadaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaObustavaNaknadaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaObustavaNaknada = uxOsobaObustavaNaknadaBindingSource.Current as Entities.OsobaObustavaNaknada;
			
			if (_currentOsobaObustavaNaknada != null)
			{
				_currentOsobaObustavaNaknada.Validate();
			}
			//_OsobaObustavaNaknada.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaObustavaNaknadaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaObustavaNaknada"/> instance.
		/// </summary>
		public Entities.OsobaObustavaNaknada SelectedOsobaObustavaNaknada
		{
			get {return this._currentOsobaObustavaNaknada;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaObustavaNaknadaDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaObustavaNaknadaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaObustavaNaknadaDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaObustavaNaknadaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaObustavaNaknadaDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaObustavaNaknadaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaObustavaNaknadaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaObustavaNaknadaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaObustavaNaknadaDataGridViewBase"/> class.
		/// </summary>
		public OsobaObustavaNaknadaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaObustavaNaknadaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaObustavaNaknadaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaObustavaNaknadaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljSjedisteDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOpisPlacanjaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxZiroRacunDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDanIsplateUMjesecuDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxModelDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPozivNaBrojDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDObustavaNaknadaTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPonavljajOdDatumaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPonavljajDoDatumaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDObustavaNaknadaTipBindingSource = new ObustavaNaknadaTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObustavaNaknadaTipBindingSource)).BeginInit();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaObustavaNaknadaErrorProvider
			// 
			this.uxOsobaObustavaNaknadaErrorProvider.ContainerControl = this;
			this.uxOsobaObustavaNaknadaErrorProvider.DataSource = this.uxOsobaObustavaNaknadaBindingSource;						
			// 
			// uxOsobaObustavaNaknadaDataGridView
			// 
			this.uxOsobaObustavaNaknadaDataGridView.AutoGenerateColumns = false;
			this.uxOsobaObustavaNaknadaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaObustavaNaknadaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxPrimateljNazivDataGridViewColumn,
		this.uxPrimateljSjedisteDataGridViewColumn,
		this.uxOpisPlacanjaDataGridViewColumn,
		this.uxZiroRacunDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxDanIsplateUMjesecuDataGridViewColumn,
		this.uxModelDataGridViewColumn,
		this.uxPozivNaBrojDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIDObustavaNaknadaTipDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxPonavljanjeSvakihMjeseciDataGridViewColumn,
		this.uxPonavljajOdDatumaDataGridViewColumn,
		this.uxPonavljajDoDatumaDataGridViewColumn			});
			this.uxOsobaObustavaNaknadaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaObustavaNaknadaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaObustavaNaknadaDataGridView.Name = "uxOsobaObustavaNaknadaDataGridView";
			this.uxOsobaObustavaNaknadaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaObustavaNaknadaDataGridView.TabIndex = 0;	
			this.uxOsobaObustavaNaknadaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaObustavaNaknadaDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaObustavaNaknadaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaObustavaNaknadaDataGridViewDataError);
			this.uxOsobaObustavaNaknadaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaObustavaNaknadaDataGridViewCellValueNeeded);
			this.uxOsobaObustavaNaknadaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaObustavaNaknadaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxPrimateljNazivDataGridViewColumn
			//
			this.uxPrimateljNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljNazivDataGridViewColumn.DataPropertyName = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.HeaderText = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.Name = "uxPrimateljNazivDataGridViewColumn";
			this.uxPrimateljNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxPrimateljSjedisteDataGridViewColumn
			//
			this.uxPrimateljSjedisteDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljSjedisteDataGridViewColumn.DataPropertyName = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.HeaderText = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.Name = "uxPrimateljSjedisteDataGridViewColumn";
			this.uxPrimateljSjedisteDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljSjedisteDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljSjedisteDataGridViewColumn.ReadOnly = false;		
			//
			// uxOpisPlacanjaDataGridViewColumn
			//
			this.uxOpisPlacanjaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOpisPlacanjaDataGridViewColumn.DataPropertyName = "OpisPlacanja";
			this.uxOpisPlacanjaDataGridViewColumn.HeaderText = "OpisPlacanja";
			this.uxOpisPlacanjaDataGridViewColumn.Name = "uxOpisPlacanjaDataGridViewColumn";
			this.uxOpisPlacanjaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOpisPlacanjaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOpisPlacanjaDataGridViewColumn.ReadOnly = false;		
			//
			// uxZiroRacunDataGridViewColumn
			//
			this.uxZiroRacunDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxZiroRacunDataGridViewColumn.DataPropertyName = "ZiroRacun";
			this.uxZiroRacunDataGridViewColumn.HeaderText = "ZiroRacun";
			this.uxZiroRacunDataGridViewColumn.Name = "uxZiroRacunDataGridViewColumn";
			this.uxZiroRacunDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxZiroRacunDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxZiroRacunDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxDanIsplateUMjesecuDataGridViewColumn
			//
			this.uxDanIsplateUMjesecuDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDanIsplateUMjesecuDataGridViewColumn.DataPropertyName = "DanIsplateUMjesecu";
			this.uxDanIsplateUMjesecuDataGridViewColumn.HeaderText = "DanIsplateUMjesecu";
			this.uxDanIsplateUMjesecuDataGridViewColumn.Name = "uxDanIsplateUMjesecuDataGridViewColumn";
			this.uxDanIsplateUMjesecuDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDanIsplateUMjesecuDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDanIsplateUMjesecuDataGridViewColumn.ReadOnly = false;		
			//
			// uxModelDataGridViewColumn
			//
			this.uxModelDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxModelDataGridViewColumn.DataPropertyName = "Model";
			this.uxModelDataGridViewColumn.HeaderText = "Model";
			this.uxModelDataGridViewColumn.Name = "uxModelDataGridViewColumn";
			this.uxModelDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxModelDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxModelDataGridViewColumn.ReadOnly = false;		
			//
			// uxPozivNaBrojDataGridViewColumn
			//
			this.uxPozivNaBrojDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPozivNaBrojDataGridViewColumn.DataPropertyName = "PozivNaBroj";
			this.uxPozivNaBrojDataGridViewColumn.HeaderText = "PozivNaBroj";
			this.uxPozivNaBrojDataGridViewColumn.Name = "uxPozivNaBrojDataGridViewColumn";
			this.uxPozivNaBrojDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPozivNaBrojDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPozivNaBrojDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObustavaNaknadaTipDataGridViewColumn
			//
			this.uxIDObustavaNaknadaTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DataPropertyName = "IDObustavaNaknadaTip";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.HeaderText = "IDObustavaNaknadaTip";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.Name = "uxIDObustavaNaknadaTipDataGridViewColumn";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxPonavljanjeSvakihMjeseciDataGridViewColumn
			//
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.DataPropertyName = "PonavljanjeSvakihMjeseci";
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.HeaderText = "PonavljanjeSvakihMjeseci";
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.Name = "uxPonavljanjeSvakihMjeseciDataGridViewColumn";
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPonavljanjeSvakihMjeseciDataGridViewColumn.ReadOnly = false;		
			//
			// uxPonavljajOdDatumaDataGridViewColumn
			//
			this.uxPonavljajOdDatumaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPonavljajOdDatumaDataGridViewColumn.DataPropertyName = "PonavljajOdDatuma";
			this.uxPonavljajOdDatumaDataGridViewColumn.HeaderText = "PonavljajOdDatuma";
			this.uxPonavljajOdDatumaDataGridViewColumn.Name = "uxPonavljajOdDatumaDataGridViewColumn";
			this.uxPonavljajOdDatumaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPonavljajOdDatumaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPonavljajOdDatumaDataGridViewColumn.ReadOnly = false;		
			//
			// uxPonavljajDoDatumaDataGridViewColumn
			//
			this.uxPonavljajDoDatumaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPonavljajDoDatumaDataGridViewColumn.DataPropertyName = "PonavljajDoDatuma";
			this.uxPonavljajDoDatumaDataGridViewColumn.HeaderText = "PonavljajDoDatuma";
			this.uxPonavljajDoDatumaDataGridViewColumn.Name = "uxPonavljajDoDatumaDataGridViewColumn";
			this.uxPonavljajDoDatumaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPonavljajDoDatumaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPonavljajDoDatumaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObustavaNaknadaTipDataGridViewColumn
			//				
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDObustavaNaknadaTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = uxIDObustavaNaknadaTipBindingSource;				
				
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaObustavaNaknadaDataGridView);
			this.Name = "OsobaObustavaNaknadaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObustavaNaknadaTipBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaObustavaNaknadaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaObustavaNaknadaDataGridViewEventArgs args = new OsobaObustavaNaknadaDataGridViewEventArgs();
				args.OsobaObustavaNaknada = _currentOsobaObustavaNaknada;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaObustavaNaknadaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaObustavaNaknada	_OsobaObustavaNaknada;
	
			/// <summary>
			/// the  Entities.OsobaObustavaNaknada instance.
			/// </summary>
			public Entities.OsobaObustavaNaknada OsobaObustavaNaknada
			{
				get { return _OsobaObustavaNaknada; }
				set { _OsobaObustavaNaknada = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaObustavaNaknadaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaObustavaNaknadaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaObustavaNaknadaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].ID;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PrimateljNaziv;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PrimateljSjediste;
						break;
					case "uxOpisPlacanjaDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].OpisPlacanja;
						break;
					case "uxZiroRacunDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].ZiroRacun;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].Iznos;
						break;
					case "uxDanIsplateUMjesecuDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].DanIsplateUMjesecu;
						break;
					case "uxModelDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].Model;
						break;
					case "uxPozivNaBrojDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PozivNaBroj;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].Napomena;
						break;
					case "uxIDObustavaNaknadaTipDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].IDObustavaNaknadaTip;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].IDOsoba;
						break;
					case "uxPonavljanjeSvakihMjeseciDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PonavljanjeSvakihMjeseci;
						break;
					case "uxPonavljajOdDatumaDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PonavljajOdDatuma;
						break;
					case "uxPonavljajDoDatumaDataGridViewColumn":
						e.Value = OsobaObustavaNaknadaList[e.RowIndex].PonavljajDoDatuma;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaObustavaNaknadaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaObustavaNaknadaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PrimateljNaziv = (System.String)e.Value;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PrimateljSjediste = (System.String)e.Value;
						break;
					case "uxOpisPlacanjaDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].OpisPlacanja = (System.String)e.Value;
						break;
					case "uxZiroRacunDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].ZiroRacun = (System.String)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].Iznos = (System.Decimal)e.Value;
						break;
					case "uxDanIsplateUMjesecuDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].DanIsplateUMjesecu = (System.DateTime)e.Value;
						break;
					case "uxModelDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].Model = (System.String)e.Value;
						break;
					case "uxPozivNaBrojDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PozivNaBroj = (System.String)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIDObustavaNaknadaTipDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].IDObustavaNaknadaTip = (System.Int32)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxPonavljanjeSvakihMjeseciDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PonavljanjeSvakihMjeseci = (System.Int32)e.Value;
						break;
					case "uxPonavljajOdDatumaDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PonavljajOdDatuma = (System.DateTime?)e.Value;
						break;
					case "uxPonavljajDoDatumaDataGridViewColumn":
						OsobaObustavaNaknadaList[e.RowIndex].PonavljajDoDatuma = (System.DateTime?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
